package main

import (
	"fmt"
	"strconv"
)

func isPalindrome(num int) bool {
	if num < 0 {
		return false
	}
	numstr := strconv.Itoa(num)
	//fmt.Printf("%T\n", numstr)
	var slice []int
	for _, char := range numstr {
		//fmt.Printf("char: %c, type: %T\n", char, char)
		digit, _ := strconv.Atoi(string(char))
		//fmt.Printf("  digit:%d, type:%T\n", digit, digit)
		slice = append(slice, digit)
		//fmt.Printf("    slice:%d,%T\n", digit, digit)
	}

	//ecils := make([]int, len(slice))
	var a = 0
	for i := len(slice) - 1; i >= 0; i-- {
		if slice[i] != slice[a] {
			return false
		}
		a++
	}

	return true

}
func main() {
	// 示例整数
	num := 1111111

	// 调用函数
	IF := isPalindrome(num)

	// 打印结果
	fmt.Println("resoult:", IF)
}
